<?php
/**
 * 商城订单.
 * User: ycp
 * Date: 2019/5/23
 * Time: 22:23
 */

namespace app\api\controller;


class Goods extends ApiCommon
{
    protected $goodsTable = 'store_goods';


    public function __construct()
    {
        parent::__construct();
    }

    //获取订单数据
    public function index()
    {
      $option = $this->request->param('data');
      $data = json_decode($option, true);
      $productData = db($this->goodsTable)->field('id,title,logo')->where(['id' => $data['goods_id']])->find();
      $product['data'] = $productData;
      $product['attr'] = $data;
      $product['addressData'] = db('StoreMemberAddress')
          ->where(['mid' => $this->openid])
          ->order('is_default desc,id desc')
          ->find();
        $this->success('', $product);
    }
}